package so.wy.servicecenter.businessbed.service.hospital.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import so.wy.servicecenter.businessbed.dao.rdb.hospital.hospital.HospitalDO;

import java.math.BigDecimal;

/**
* @author wdl
* @date 2020-04-08
*/
@Data
@NoArgsConstructor
public class HospitalDTO{

	/** 医院ID */
	private Long hospitalId;
	/** 医院名称 */
	private String hospitalName;
	/** 医院Logo */
	private String hospitalLogo;
	/** 联系电话 */
	private String hospitalContactPhone;
	/** 医院地址 */
	private String hospitalAddress;
	/** 是否定价 */
	private Integer isPrice;
	/** 设备数量 */
	private Integer countDevice;
	/** 开单数量 */
	private Integer countOrder;
	/** 总订单金额 */
	private BigDecimal amountTotal;
	/** 总支付金额 */
	private BigDecimal amountPay;
	/** 免单金额 */
	private BigDecimal amountPayFree;
	/** 排序 */
	private Integer sortNum;

	public HospitalDTO(HospitalDO hospitalDO){
		if(hospitalDO==null){
			return ;
		}

		this.hospitalId = hospitalDO.getHospitalId();
		this.hospitalName = hospitalDO.getHospitalName();
		this.hospitalLogo = hospitalDO.getHospitalLogo();
		this.hospitalContactPhone = hospitalDO.getHospitalContactPhone();
		this.hospitalAddress = hospitalDO.getHospitalAddress();
		this.isPrice = hospitalDO.getIsPrice();
		this.countDevice = hospitalDO.getCountDevice();
		this.countOrder = hospitalDO.getCountOrder();
		this.amountTotal = hospitalDO.getAmountTotal();
		this.amountPay = hospitalDO.getAmountPay();
		this.amountPayFree = hospitalDO.getAmountPayFree();
		this.sortNum = hospitalDO.getSortNum();
	}

	public HospitalDO convert2DO(){
		HospitalDO hospitalDO = new HospitalDO();
		hospitalDO.setHospitalId(this.hospitalId);
		hospitalDO.setHospitalName(this.hospitalName);
		hospitalDO.setHospitalLogo(this.hospitalLogo);
		hospitalDO.setHospitalContactPhone(this.hospitalContactPhone);
		hospitalDO.setHospitalAddress(this.hospitalAddress);
		hospitalDO.setIsPrice(this.isPrice);
		hospitalDO.setCountDevice(this.countDevice);
		hospitalDO.setCountOrder(this.countOrder);
		hospitalDO.setAmountTotal(this.amountTotal);
		hospitalDO.setAmountPay(this.amountPay);
		hospitalDO.setAmountPayFree(this.amountPayFree);
		hospitalDO.setSortNum(this.sortNum);
		return hospitalDO;
	}

}
